package com.bitoon.basketdudes.jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author paco
 */
@Entity
@Table(name = "ranking_totales", catalog = "basketdudes", schema = "rankings")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RankingTotales.findAll", query = "SELECT r FROM RankingTotales r"),
    @NamedQuery(name = "RankingTotales.findByZonaId", query = "SELECT r FROM RankingTotales r WHERE r.zonaId = :zona_id")
})

public class RankingTotales implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @SequenceGenerator(name="ranking_totales_id_generator", sequenceName="rankings.ranking_totales_id_seq", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ranking_totales_id_generator")
    @Basic(optional=false)
    @Column(name = "id")
    private Integer id = 0;
    
    
    @Basic(optional = false)
    @NotNull
    @Column(name = "zona_id")
    private short zonaId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "categoria")
    private short categoria;
    @Basic(optional = false)
    @NotNull
    @Column(name = "division")
    private short division;
    @Basic(optional = false)
    @NotNull
    @Column(name = "total")
    private Integer total;
    

    public RankingTotales() {
    }

    public RankingTotales(Integer total) {
        this.total = total;
    }

    public RankingTotales(Integer total, short zonaId, short categoria, short division, int puntos) {
        this.total      = total;
        this.zonaId     = zonaId;
        this.categoria  = categoria;
        this.division   = division;
    }

    public short getZonaId() {
        return zonaId;
    }

    public void setZonaId(short zonaId) {
        this.zonaId = zonaId;
    }

    public short getCategoria() {
        return categoria;
    }

    public void setCategoria(short categoria) {
        this.categoria = categoria;
    }

    public short getDivision() {
        return division;
    }

    public void setDivision(short division) {
        this.division = division;
    }


    public void setTotal(int valor) {
        this.total = valor;
    }

    public Integer getTotal() {
        return total;
    }
  
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (total != null ? total.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RankingTotales)) {
            return false;
        }
        RankingTotales other = (RankingTotales) object;
        if ((this.total == null && other.total != null) || (this.total != null && !this.total.equals(other.total))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bitoon.tres.RankingTotales[ Id=" + id + " ]";
    }
    
}
